package cn.bdqn.service.impl;

import cn.bdqn.domain.Bunk;
import cn.bdqn.mapper.BunkMapper;
import cn.bdqn.service.BunkService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class BunkServiceImpl implements BunkService {

    @Resource
    private BunkMapper bunkMapper;

    @Override
    public List<Bunk> queryByRoomId(Integer roomId) {
        return bunkMapper.selectByRoomId(roomId);
    }

    @Override
    public void modifyPatientById(Bunk bunk) {
        bunkMapper.updateByPrimaryKeySelective(bunk);
    }

    @Override
    public Bunk queryById(Integer id) {
        return bunkMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Bunk> queryAll() {
        return bunkMapper.selectAll();
    }

    @Override
    public void modifyBunkById(Bunk bunk) {
        bunkMapper.updateByPrimaryKeySelective(bunk);
    }

    @Override
    public void modifyPersonNameAndPersonPhoneById(Integer id) {
        bunkMapper.updatePersonNameAndPersonPhoneById(id);
    }
}
